]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnails: Fix removal of multiple workspaces
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 24 Apr 2014 23:56:31 +0000 (01:56 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Apr 2014 15:50:38 +0000 (17:50 +0200)
When workspaces have been removed, we need to remove the corresponding
thumbnails as well; the number of thumbnails that need removing is
the difference between the old number of workspaces and the new one.
Currently we assume that the old number of workspaces corresponds to
the number of existing thumbnails, but that may actually be wrong:
A thumbnail will still be animated out after its workspace has been
removed. As a result, we end up removing too many thumbnails when a
workspace is removed while a thumbnail of a previously removed workspace
is still animating out. Fix this by basing the old number of workspaces
only on thumbnails that have not been removed previously.

https://bugzilla.gnome.org/show_bug.cgi?id=728820

js/ui/workspaceThumbnail.js

index 113f2a71bb77c2ef3365d2e410eb3c43ee107f5e..1eb843dc9d46c27c9da87cc9d83003647b5e91d6 100644 (file)
@@ -903,7 +903,10 @@ const ThumbnailsBox = new Lang.Class({
     },
 
     _workspacesChanged: function() {
-        let oldNumWorkspaces = this._thumbnails.length;
+        let validThumbnails = this._thumbnails.filter(function(t) {
+            return t.state <= ThumbnailState.NORMAL;
+        });
+        let oldNumWorkspaces = validThumbnails.length;
         let newNumWorkspaces = global.screen.n_workspaces;
         let active = global.screen.get_active_workspace_index();